<template>
	<view v-if="pageshow">
	<view class="content">
		<block v-for="(item,index) in list" :key="index">
		<view class="item" @click="jump('/pages/tie/view?id='+item.tieid)">
		
			<view class="item_right">
				<view class="item_right_top">
					<view class="ir1">{{item.name}}</view>
					<view class="ir2">{{item.addtime}}</view>
				</view>
				<view class="desc">[评论内容]{{item.content}}</view>
			</view>
			
		</view>
			<u-line color="#F1F1F1" />
		</block>
		<u-loadmore v-if="!nodata" :load-text="loadText" :status="status" icon-type="flower" margin-top="20"
			margin-bottom="20" />
			
			 <u-empty text=" 暂无数据" mode="list" v-if="nodata"></u-empty>
		<foot></foot>
		</view>
		 <auth :isauth="check_auth"></auth>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				readnum:3,
				count:0,
				replyid:0,
				sonreplyid:0,
				item:{},
				id:0,
				comment: "",
				commentList: [],
				cid:0,
				status: 'loadmore',
				page: 1,
				nodata: false,
				loadText: {
					loadmore: '轻轻上拉',
					loading: '努力加载中',
					nomore: '实在没有了'
				},
				pageshow: false,
				list: [],
			}
		},
		onLoad(e) {
			console.log(this.user,10)
			if (e.id){
				this.id=e.id
			}
			
			this.item_list()
			
		},
		onReachBottom() {
			if (this.status != 'loadmore') {
				return;
			}
			this.status = "loading"
			this.page++;
			this.item_list()
		},
		methods: {
			
			item_list() {
				this.$u.post('index.php?mod=app&act=list&table=comment', {
					limit: 15,
					uid:uni.getStorageSync("uid"),
					page: this.page,
					mypl:1
				}).then(res => {
					this.pageshow = true
					this.active = false
					let total = res.count
					this.count = res.count
					
					if (this.page == 1)
						this.list = res.data
					else
						this.list = this.list.concat(res.data)
			      
					if (total == this.list.length) {
			
						if (this.list.length == 0) {
							this.nodata = true
						} else
							this.status = "nomore"
						//this.loadText.nomore = (this.total > res.pagesize) ? "实在没有了" : ""
					} else {
						this.status = "loadmore"
					}
			
				});
			}
           
			
			
			
			
		}
	}
</script>

<style>
	.name{font-size: 16px; margin-bottom: 20rpx;}
	.desc{
	
		font-size:14px ;
		color: #808080;
		 margin-top: 10px;
	}
	.books{margin-top: 30rpx;}
 .content{padding: 20rpx;}
 .item{margin: 30rpx auto;display: flex;}
 .item_left{}
 .item_right_top{display: flex;justify-content: space-between; flex-direction: row;}
 .ir1{font-size: 16px;}
 .ir2{color: #999;font-size: 12;}
 .item_right{flex:1;display: flex;flex-direction: column; margin-left: 10px; justify-content: center;}
</style>
